package chixing.day12.generic;

public class LocationTest {
    public static void main(String[] args) {
      Location<Integer,Float> location = new Location<Integer,Float>(1,11.1f);
    location.setX(2);//x的类型只能是Integer==保证了数据类型的安全
    location.setY(22.2f);//y的类型只能是Float==保证了数据类型安全

    Location<String,Integer> location1 = new Location<String,Integer>();
    location1.setX("1");
    location1.setY(2);
    }
}
